package com.util;

import java.util.Random;

public class RandomKey {
    final static String d = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    public static String getRandomKey(int length){
        Random random=new Random();
        StringBuffer sb=new StringBuffer();
        for(int i=0;i<length;i++){
            int number=random.nextInt(62);
            sb.append(d.charAt(number));
        }
        return sb.toString();
    }

}
